<template>
  <section class="text-container clearfix">
    <Top />
    <main>
      <Tab :currentIndex="currentIndex" @select="select" />
      <div class="content" v-show="currentIndex == 1"></div>
      <div class="content" v-show="currentIndex == 2"></div>
      <div class="content" v-show="currentIndex == 3">
        <Content :list="list" />
      </div>
    </main>
  </section>
</template>

<script>
import { list } from '@/data/data.js'
import Top from './components/Top'
import Tab from './components/Tab'
import Content from './components/Content'
export default {
  name: 'Test',
  components: {
    Top,
    Tab,
    Content
  },
  data () {
    return {
      currentIndex: 1,
      list: []
    }
  },
  created () {
    this.list = list
  },
  mounted () {

  },

  methods: {
    select (id) {
      this.currentIndex = id
    }
  }
}
</script>

<style scoped>
.text-container {
  width: 100%;
  height: 100vh;
  background-color: #fefbea;
  position: relative;
  overflow-y: scroll;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}
main {
  width: 100%;
  position: absolute;
  top: 8%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 5%;
  box-sizing: border-box;
}
main .content {
  background-color: #ffffff;
  width: 90%;
  height: auto;
  position: absolute;
  top: 50%;
  box-sizing: border-box;
  border-radius: 10px;
}
</style>